﻿<template>
  <crud
    :entity-name="entityName"
    :dialog-enity.sync="entity"
    :request-param="pagerequest"
    :keyword-placeholder="keywordPlaceholder"
    :dialog-optins="dialogOptins"
    @dialogFormClearValidate="handleFormClearValidate"
    @dialogFormValidate="handleFormValidate"
  >
    <template slot="FilterItems" />

    <template slot="TableColumns">

      <el-table-column
        prop="id"
        label="Id"
      />

      <el-table-column
        prop="schemeName"
        sortable="custom"
        label="名称"
      />
      <el-table-column
        prop="schemeVersion"
        label="版本号"
      />
      <el-table-column
        prop="description"
        :label="L('Description')"
      />
      <el-table-column label="状态">
        <template slot-scope="{row}">
          <el-tag :type="row.disabled | booleanTagFilter(true)">
            {{ row.disabled ? '禁用' : '正常' }}
          </el-tag>
        </template>
      </el-table-column>
      <el-table-column
        sortable="custom"
        prop="creationTime"
        :label="L('CreationTime')"
      >
        <template slot-scope="{row}">
          <span>{{ row.creationTime | parseTime('{y}-{m}-{d} {h}:{i}:{s}') }}</span>
        </template>
      </el-table-column>
    </template>

    <createOrUpdateCommonTask
      ref="CreateOrEditDialog"
      slot="CreateOrEditDialog"
      :entity="entity"
    />
  </crud>
</template>
<script>
import crud from '@/components/CrudCodeBuild'
import createOrUpdateCommonTask from './components/CreateOrUpdateFlowScheme'

export default {
  name: 'FlowScheme',
  components: { crud, createOrUpdateCommonTask },
  data() {
    return {
      entity: {},
      entityName: 'flowScheme',
      pagerequest: null,
      keywordPlaceholder: this.L('FlowScheme') + '/' + this.L('Name'),
      dialogOptins: {
        width: '880px',
        top: '3vh',
        createEnityParam: null, // { permissions: [] },
        createTitle: this.L('Create'),
        editTitle: this.L('Edit'),
        deleteConfirm: this.L('Delete')
      }
    }
  },
  methods: {
    handleFormClearValidate() {
      this.$refs.CreateOrEditDialog.clearValidate()
    },
    handleFormValidate(cb) {
      this.$refs.CreateOrEditDialog.validate(cb)
    }
  }

}

</script>
